package com.link2room.aeriabots.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by LN on 2016/12/1.
 */
@Entity
@Table(name = "wx_reply_template")
@DynamicInsert
public class WxReplyTemplate extends BaseEntity{
    public enum _MsgType{
        news,   //图文
        music,  //音乐
        video,  // 视频
        voice,  // 音频
        image,  // 图片
        text    // 文字
    }
    private String templateId;
    private String msgType;
    private String templateName;


    @Basic
    @Column(name = "msg_type", nullable = true, length = 16)
    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }
    @Basic
    @Column(name = "template_id", nullable = true, length = 16)
    public String getTemplateId() {
        return templateId;
    }

    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }
    @Basic
    @Column(name = "template_name", nullable = true, length = 16)
    public String getTemplateName() {
        return templateName;
    }

    public void setTemplateName(String templateName) {
        this.templateName = templateName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WxReplyTemplate that = (WxReplyTemplate) o;

        if (templateId != null ? !templateId.equals(that.templateId) : that.templateId != null) return false;
        if (msgType != null ? !msgType.equals(that.msgType) : that.msgType != null) return false;
        if (templateName != null ? !templateName.equals(that.templateName) : that.templateName != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = templateId != null ? templateId.hashCode() : 0;
        result = 31 * result + (msgType != null ? msgType.hashCode() : 0);
        result = 31 * result + (templateName != null ? templateName.hashCode() : 0);
        return result;
    }
}
